package apiday08.homework;

import java.lang.reflect.Method;

public class ReflectDemo6 {
    public static void main(String[] args) throws Exception {
        Class cls = Class.forName("apiday08.homework.Person");
        if (cls.isAnnotationPresent(AutoRunClass.class)) {
            System.out.println("类被标注了");
        } else {
            System.out.println("类没有被标注");
        }

        Method method = cls.getMethod("study");
        if (method.isAnnotationPresent(AutoRunMethod.class)){
            System.out.println("study()方法被标注了");
            AutoRunMethod arm = method.getAnnotation(AutoRunMethod.class);
            int value = arm.value();
            System.out.println(value);
        } else {
            System.out.println("study()方法没有被标注");
        }


    }
}
